home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / System / ThreadLib 1.0d1 / Description next >
Encoding:
Text File  |  1994-02-11  |  1.5 KB  |  30 lines  |  [TEXT/KAHL]

  1. ThreadLib implements nonpreemptive multiple thread execution within
  2. a single application. It does not require any extensions, should work
  3. with all Macintosh models (from the Plus on up), and works with
  4. systems 6.0 (tested on 6.0.5) under Finder or MultiFinder, and
  5. system 7.0. ThreadLib compiles into a small library of about 4.5K,
  6. so it won't add much overhead to your application. A small test
  7. application and THINK C project demonstrates how threads are used.
  8. Best of all, the source code, entirely in C, is free.
  9.  
  10. Every thread has its own stack and exception handling environment;
  11. all other global application data is shared by the threads. Context
  12. switches are very efficient since they involve only a few operations
  13. to save the current thread's state, followed by a longjmp to the new
  14. thread and restoration of the new thread's exception environment. There
  15. are also no restrictions on the objects that can be allocated on a
  16. thread's stack.
  17.  
  18. The rest of this file [ThreadLib.c] is heavily commented, so you should
  19. be able to follow how threads are implemented. Each external function has
  20. a description of its parameters and what it does.
  21.  
  22. Also included is an exception handling library. Exceptions are handled
  23. using the standard C routines setjmp and longjmp, and so this library
  24. should be easy to port to a native PowerPC implementation. Comments
  25. in ExceptionLib.c explain how to use the exceptions.
  26.  
  27. ThreadLib was written using THINK C 5.0.4. Some minor changes may be
  28. needed to port it to MPW C. All suggestions and enhancements are
  29. welcome.
  30.